interface ResponseData {
  code: number
  message: string
  ok: boolean
}

export interface SpuData {
  id?: number | string
  spuName: string
  description: string
  category3Id: number | string
  tmId: number | string
  spuImageList: null | spuImageData[]
  spuSaleAttrList: null | spuSaleAttrData[]
}

export type SpuDataList = SpuData[]

export interface HasSpuResponseData extends ResponseData {
  data: {
    records: SpuDataList
    total: number
    size: number
    current: number
    searchCount: boolean
    pages: number
  }
}

export interface Trademark {
  id: number
  tmName: string
  logoUrl: string
}

export interface AllTrademarkResponseData extends ResponseData {
  data: Trademark[]
}

export interface spuImageData {
  id?: number
  imgName?: string
  imgUrl?: string
  createTime?: string
  updateTime?: string
  spuId?: number
  name?: string
  url?: string
}

export interface spuImageListResponseData extends ResponseData {
  data: spuImageData[]
}

interface spuSaleAttrValue {
  id?: number
  createTime?: string
  updateTime?: string
  saleAttrValueName: string
  baseSaleAttrId: number
  spuId?: number
}

export interface spuSaleAttrData {
  id?: number
  createTime?: string
  updateTime?: string
  baseSaleAttrId: number
  saleAttrName: string
  spuId?: number
  spuSaleAttrValueList: spuSaleAttrValue[]
  flag?: boolean //用于控制属性值显示模式,false:浏览模式;true:编辑模式
  newSaleAttrValueName?: string //收集新增的属性值名称
}

export interface spuSaleAttrListResponseData extends ResponseData {
  data: spuSaleAttrData[]
}

export interface baseSaleAttrData {
  id: number
  name: string
}

export interface AllBaseSaleAttrResponseData extends ResponseData {
  data: baseSaleAttrData[]
}

export interface SkuData {
  category3Id: number | string
  spuId: number | string
  tmId: number | string
  skuName: string
  price: number | string
  weight: number | string
  skuDesc: string
  skuAttrValueList: Array<{ attrId: number | string; valueId: number | string }>
  skuSaleAttrValueList: Array<{
    saleAttrid: number | string
    saleAttrValueId: number | string
  }>
  skuDefaultImg: string
}

export interface SkuInfoResponseData extends ResponseData {
  data: SkuData[]
}
